package com.skyable.account.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skyable.account.entity.SysUser;
import com.skyable.common.common.ServiceResult;

import java.util.List;

/**
 * @author GaoYuan
 * @title: IUserService
 * @projectName spring-cloud-demo
 * @description: TODO
 * @date 2021/3/2317:53
 */
public interface IUserService extends IService<SysUser> {

    /**
     * 创建租户表
     * @param domainId
     * @return
     */
    ServiceResult<Boolean> createCompanyTable(Long domainId);

    /**
     * 新增用户
     * @param sysUser
     * @param roleList
     * @return
     */
    ServiceResult<SysUser> insertUser(SysUser sysUser, List<Long> roleList);

    /**
     * 更新用户
     * @param sysUser
     * @param roleList
     * @return
     */
    ServiceResult<SysUser> updateUser(SysUser sysUser, List<Long> roleList);

    /**
     * 分页获取用户列表
     * @param page
     * @param limit
     * @param sysUser
     * @return
     */
    ServiceResult<IPage<SysUser>> findUserListByPage(int page, int limit, SysUser sysUser);

    /**
     * 获取所有用户列表
     * @return
     */
    ServiceResult<List<SysUser>> findUserList();

    /**
     * 根据ID查询用户
     * @param userId
     * @return
     */
    ServiceResult<SysUser> findUserById(Long userId);

    /**
     * 删除用户
     * @param userId
     * @return
     */
    ServiceResult<Integer> deleteUserById(Long userId);
}
